<template>
	<div style="padding-bottom: 100px;">
		<view style="background-color: #ffffff;margin: 10px;border-radius: 12px;padding: 15px;">
			<uni-forms ref="form" :modelValue="formData" :rules="rules" labelWidth="75px">
				<view style="display: flex;">
					<view style="margin-right: 30px;">
						<checkbox-group style="padding-top: 8px;" @change="setCarrier">
							<label>
								<checkbox :value="false" :checked="carrierIdFlag" />设置承运商
							</label>
						</checkbox-group>
					</view>
					<view style="flex: 1;margin-top: 5px;">
						<uni-forms-item label="承运方" style="width: 90%;" labelWidth="55px">
							<uni-data-select :disabled="!carrierIdFlag" v-model="formData.carrierId" :localdata="carrierId"
								style="background-color: white;" />
						</uni-forms-item>
					</view>
				</view>
				<uni-forms-item label="设置线路">
					<!-- <uni-data-select  v-model="setHowLine" :localdata="setLine"
						style="background-color: white;" /> -->
						
					<span v-if="setHowLine=='1'"> <!--人工设置-->
						<view  style="margin-top: 20px;">
							<uni-data-select :disabled="true" @change="startChange" v-model="formData_point.startLine" placeholder="请选择起点" :localdata="startLine"
								style="background-color: white;" />
						</view>
						<!--下箭头-->
						<view style="height: 20px;text-align: center;">
							<uni-icons  type="arrow-down" size="18" color="#e5e5e5;"></uni-icons>
						</view>
						<!--动态添加中间节点选择框-->
						<view v-for="(item,index) in allCenterLine" :key="index" style="margin-top: 10px;">
							<view style="display: flex;align-items: center;">
								<uni-data-select :clear="false"  @change="centerChange(index,item.value)" v-model="item.value" placeholder="请选择中间节点" :localdata="centerLine"
									style="background-color: white;flex: 3;" />
								<uni-icons  @click="deleteCenterLine(index)" type="trash" size="20" color="#bf5f09;" style="flex: 1;text-align: center;"></uni-icons>
							</view>
							<!--下箭头-->
							<view style="height: 20px;text-align: center;">
								<uni-icons  type="arrow-down" size="18" color="#e5e5e5;"></uni-icons>
							</view>
						</view>
						
						<!-- <view>
							<view hover-class="buttonHover" @click="addCenterLine" style="color: #bf5f09;height: 35px;display: flex;align-items: center;font-size: 12px;justify-content: center;">
								<uni-icons  type="plus" size="16" color="#bf5f09"></uni-icons>
								添加中间节点
							</view>
						</view> -->
						
						<!--下箭头-->
						<view style="height: 20px;text-align: center;">
							<uni-icons  type="arrow-down" size="18" color="#e5e5e5;"></uni-icons>
						</view>
						<view>
							<uni-data-select :disabled="true" @change="endChange" v-model="formData_point.endLine" placeholder="请选择终点" :localdata="endLine"
								style="background-color: white;" />
						</view>
					</span>
				</uni-forms-item>
				<uni-forms-item label="司机" required>
					<!-- <uni-data-select @change="selectDriver" v-model="formData.driverId" :localdata="driverId"
						style="background-color: white;" /> -->
					<uni-combox @input="inpuDriverId" v-model="driverJson.driverName" :candidates="driverId" placeholder="输入检索司机"></uni-combox>
				</uni-forms-item>
				<uni-forms-item label="身份证号" required>
					<uni-combox @input="inpuIdCardNo" v-model="driverJson.idCardNo" :candidates="idCardNo" placeholder="输入检索司机身份证号"></uni-combox>
					<!-- <uni-easyinput type="text"  v-model="driverJson.idCardNo" placeholder="请输入司机身份证号" /> -->
				</uni-forms-item>
				<uni-forms-item label="联系电话" required>
					<uni-combox @input="inpuPhoneNumber" v-model="driverJson.phoneNumber" :candidates="phoneNumber" placeholder="输入检索司机联系电话"></uni-combox>
					<!-- <uni-easyinput type="number"  v-model="driverJson.phoneNumber" placeholder="请输入司机联系电话" /> -->
				</uni-forms-item>
				<uni-forms-item label="车牌号" required>
					<uni-combox @input="inputPlateNumber" :candidates="plateNumber" placeholder="输入检索车牌号"
						v-model="plateNumberName"></uni-combox>
					<view v-if="carInfo.carId">
						{{carType_[carInfo.carType]}} {{carInfo.carLength}}米，行驶证号：{{carInfo.drivingLicenseNo}}
					</view>
				</uni-forms-item>
				<uni-forms-item label="车型" required>
					<uni-data-select :disabled="cartypeFlag" @change="selectCarType" v-model="carInfo.carType" :localdata="carType"
						style="background-color: white;" />
				</uni-forms-item>
				<!-- <uni-forms-item label="挂车牌号">
					<uni-easyinput type="text" v-model="formData.hangPlateNumber" placeholder="挂车牌号" />
				</uni-forms-item> -->
				<uni-forms-item label="计划提货时间" name="estPickupTime" required>
					<uni-datetime-picker :disabled="true" type="datetime" v-model="formData.estPickupTime" />
				</uni-forms-item>
				<!-- <uni-forms-item label="计划发车时间" name="estDepartTime" required>
					<uni-datetime-picker type="datetime" v-model="formData.estDepartTime" />
				</uni-forms-item> -->
				<uni-forms-item label="计划到达时间" name="estArriveTime" required>
					<uni-datetime-picker :disabled="true" type="datetime" v-model="formData.estArriveTime" />
				</uni-forms-item>
				<uni-forms-item label="押运人">
					<uni-easyinput type="text" v-model="formData.escortor" placeholder="押运人" />
				</uni-forms-item>
				<uni-forms-item label="押运人电话">
					<uni-easyinput type="text" v-model="formData.escortorPhone" placeholder="押运人电话" />
				</uni-forms-item>
				<uni-forms-item label="押运人证件">
					<uni-easyinput type="text" v-model="formData.escortorIdcard" placeholder="押运人证件" />
				</uni-forms-item>
				<uni-forms-item label="备注">
					<uni-easyinput type="textarea" v-model="formData.remark" placeholder="车辆相关备注说明" />
				</uni-forms-item>
			</uni-forms>
		</view>
		<!--路段设置-->
		<template v-if="setHowLine=='1'">
			<view v-for="(item,index) in allLine" :key="index" style="background-color: #ffffff;margin: 10px;border-radius: 12px;padding: 15px;">
				<!-- <view style="font-weight: bold;">
					路段：{{item.prev}}
					<uni-icons  type="arrow-right" size="16"></uni-icons>
					{{item.next}}
				</view> -->
				<view style="margin-top: 20px;">
					<uni-forms  :modelValue="item.feeList" labelWidth="90px" labelPosition="top">
						<view style="display: flex;margin-bottom: 10px;">
							<view style="flex: 1;margin-right: 5px;">
								<checkbox-group style="padding-top: 8px;" @change="setFeeFlag=!setFeeFlag">
									<label>
										<checkbox :value="false" :checked="setFeeFlag" />设置费用
									</label>
								</checkbox-group>
							</view>
						</view>
						<!-- <uni-forms-item label="运费计算方式">
							<uni-data-select v-model="item.feeList.feeMode" :localdata="feeMode"
								style="background-color: white;" />
						</uni-forms-item> -->
						<view style="display: flex;">
							<view style="flex: 1;margin-right: 30px;">
								<uni-forms-item label="应付运输费" >
									<uni-easyinput :disabled="!setFeeFlag" type="text" v-model="item.feeList.apFrt" placeholder="应付运输费" />
								</uni-forms-item>
							</view>
							<view style="flex: 1;">
								<uni-forms-item label="应付其它费">
									<uni-easyinput :disabled="!setFeeFlag" type="text" v-model="item.feeList.apOther" placeholder="应付其它费" />
								</uni-forms-item>
							</view>
						</view>
						<!-- <view style="display: flex;">
							<view style="flex: 1;margin-right: 30px;">
								<uni-forms-item label="现付" >
									<uni-easyinput type="text" v-model="item.feeList.cod" placeholder="现付费用" />
								</uni-forms-item>
							</view>
							<view style="flex: 1;">
								<uni-forms-item label="现付油卡">
									<uni-easyinput type="text" v-model="item.feeList.codGascard" placeholder="现付油卡" />
								</uni-forms-item>
							</view>
						</view>
						<view style="display: flex;">
							<view style="flex: 1;margin-right: 30px;">
								<uni-forms-item label="回付" >
									<uni-easyinput type="text" v-model="item.feeList.pom" placeholder="回付" />
								</uni-forms-item>
							</view>
							<view style="flex: 1;">
								<uni-forms-item label="到付">
									<uni-easyinput type="text" v-model="item.feeList.pod" placeholder="到付" />
								</uni-forms-item>
							</view>
						</view>
						<view style="display: flex;">
							<view style="flex: 1;margin-right: 30px;">
								<uni-forms-item label="月结" >
									<uni-easyinput type="text" v-model="item.feeList.ms" placeholder="月结" />
								</uni-forms-item>
							</view>
							<view style="flex: 1;"></view>
						</view> -->
						<uni-forms-item label="结算方式">
							<uni-data-select :disabled="!setFeeFlag" v-model="item.feeList.settleMode" :localdata="settleMode"
								style="background-color: white;" />
							<view v-if="item.feeList.settleMode=='5'" style="margin-top: 20px;">
								<uni-combox :candidates="payType_day" placeholder="请选择月结天数"
									v-model="item.feeList.ms"></uni-combox>
							</view>
						</uni-forms-item>
						<!-- <uni-forms-item label="计划发车时间">
							<uni-datetime-picker type="datetime" v-model="item.feeList.estDepartTime" />
						</uni-forms-item>
						<uni-forms-item label="计划到达时间">
							<uni-datetime-picker type="datetime" v-model="item.feeList.estArriveTime" />
						</uni-forms-item> -->
					</uni-forms>
				</view>
			</view>
		</template>
		<view
			style="background-color: #ffffff;z-index: 2;height: 70px;width:100%;position: fixed;bottom: 0;display: flex;box-shadow: 0px 0px 11px rgba(0, 0, 0, 0.1);">
			<view
				style="display: flex;align-items: center;width: 50%;height: 60px;justify-content: center;">
				<view @click="cancelSubmit()" hover-class="buttonHover"
					style="height: 35px;background-color: #ffffff;border:1px solid #bf5f09;color: #bf5f09;width: 100px;display: flex;justify-content: center;align-items: center;border-radius: 4px;">
					取消</view>
			</view>
			<view
				style="display: flex;align-items: center;width: 50%;height: 60px;justify-content: center;">
				<view @click="submit()" hover-class="buttonHover"
					style="height: 35px;background-color: #bf5f09;color: #ffffff;width: 100px;display: flex;justify-content: center;align-items: center;border-radius: 4px;">
					确定调度</view>
			</view>
		</view>
	</div>
</template>

<script>
	import {getWayBillDetails,addLine,addSchedule} from '@/api/system/waybill.js';
	import {getCarrierList,} from '@/api/system/carrier.js';
	import {getDeptList} from '@/api/system/project.js';
	import {getDriverList,getCarrierCarList,getCarrierCarDetails} from '@/api/system/driver.js';
	import {getDicts} from '@/api/system/dict.js'
	export default {
		data() {
			return {
				formData: {
					carrierId:'',
					driverId:'',
					driverJson:{},  //司机Json数据
					carId:'',
					carJson:{},  //车辆Json数据
					escortor:'',
					escortorPhone:'',
					escortorIdcard:'',
					remark:'',
					
					deptId:'',  //部门id
					feeList:[],
					waybillIds:[],
					lineId:'',  //线路id
				},
				// 校验规则
				rules: {
					estPickupTime:{
						rules: [{
							required: true,
							errorMessage: '请选择计划提货时间',
						}]
					},
					// estDepartTime:{
					// 	rules: [{
					// 		required: true,
					// 		errorMessage: '请选择计划发车时间',
					// 	}]
					// },
					estArriveTime:{
						rules: [{
							required: true,
							errorMessage: '请选择计划到达时间',
						}]
					},
					driverId: {
						rules: [{
							required: true,
							errorMessage: '请选择司机',
						}]
					}
				},
				//承运商单选框选中状态
				carrierIdFlag:false,
				//下拉框 ->承运方
				carrierId: [],
				//下拉框->司机
				driverId:[],
				//下拉框->司机身份证号
				idCardNo:[],
				//下拉框->司机电话
				phoneNumber:[],
				//所有司机集合
				allDriverList:[],
				driverJson:{
					idCardNo:'',
					phoneNumber:''
				},

				setHowLine:'1',
				//下拉框 ->设置线路
				setLine: [
					// {
					// 	value: '0',
					// 	text: "固定线路"
					// },
					{
						value: '1',
						text: "人工设置"
					}
				],
				formData_point:{
					startLine:'',
					endLine:'',
				},
				//下拉框 ->起始点
				startLine: [],
				//中间所有节点值
				allCenterLine:[],
				//下拉框 ->中间节点
				centerLine: [],
				//下拉框 ->终点
				endLine: [],
				//所有节点值数组
				allLine:[
					{
						prev:'',
						next:'',
						feeList:{
							settleMode:'',
							feeMode:'',
							apFrt:'',
							apOther:'',
							cod:'',
							codGascard:'',
							pom:'',
							pod:'',
							ms:'',
							estDepartTime:'',
							estArriveTime:'',
						}
					}
				],
				//下拉框 ->车型
				carType: [],
				//下拉框 ->运费计算方式
				feeMode: [],
				//下拉框 ->结算方式
				settleMode:[],
				//下拉框 ->月结多少天
				payType_day: ['7', '15', '30', '45', '60'],
				
				//下拉框 ->车牌号
				plateNumber: [],
				plateNumberName:'',
				plateNumberObject:[],  //车辆数据
				//节流函数标志
				statu:true,
				carInfo:[],
				carJson:{},
				carType_:[],
				//车型置灰标识
				cartypeFlag:false,
				//运单id
				waybillIds:'',
				//运单详情
				waybillDetails:{},
				
				//设置费用
				setFeeFlag:false
			}
		},
		onLoad(e) {
			if(e.waybillIds)
			{
				uni.showLoading({
					title: '正在加载',
				})
				this.waybillIds=e.waybillIds
				//获取运单详情
				getWayBillDetails(e.waybillIds).then(res => {
					uni.hideLoading()
					if (res.code == '200') {
						this.waybillDetails = res.data
						this.formData_point.startLine=this.waybillDetails.shipNetId  //起点默认为发货网点
						this.formData_point.endLine=this.waybillDetails.deliveryNetId  //终点默认为收货网点
						this.formData.deptId=this.waybillDetails.deptId
						//承运商单选框选中状态
						this.carrierIdFlag=this.formData.carrierId?true:false;
						//起始点
						this.startLine.forEach(item => {
							if (item.value !== this.waybillDetails.shipNetId) {
								item.disable = true
							}
						})
						this.initSort() //
						//终点
						this.endLine.forEach(item => {
							if (item.value === this.waybillDetails.shipNetId) {
								item.disable = true
							}
						})
						
						this.formData.estPickupTime=this.waybillDetails.shipPlanTime  //计划提货时间
						this.formData.estArriveTime=this.waybillDetails.deliveryPlanTime //计划到达时间
						
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
							
				})
			}
		},
		created() {
			//获取承运方下拉框
			getCarrierList({pageNum:1,pageSize:1000}).then(res => {
				//承运方下拉框
				this.carrierId = res.rows.map(item => {
					return {
						value: item.carrierId,
						text: item.carrierName+' '+item.contactPerson+' '+item.phone
					}
				})
			})
			//获取部门网点
			getDeptList().then(res=>{
				//中间节点
				this.centerLine=res.data.map(item=>{
					return {
						value:item.deptId,
						text:'【'+(item.deptType==='3'?'部门':'网点')+'】'+item.deptName
					}
				})
				//获取起始点下拉框
				this.startLine=JSON.parse(JSON.stringify(this.centerLine))
				//获取终点下拉框
				this.endLine=JSON.parse(JSON.stringify(this.centerLine))
			})
			
			//获取司机
			getDriverList({pageNum:1,pageSize:1000}).then(res => {
				//司机下拉框
				this.allDriverList = res.rows.map(item => {
					return {
						value: item.driverId,
						text: item.driverName,
						idCardNo:item.idCardNo,
						phoneNumber:item.phoneNumber,
						plateNumberName:item.plateNumber,
						driverJson:JSON.stringify(item)
					}
				})
				this.driverId=res.rows.map(item=>{
					return item.driverName
				})
				this.idCardNo=res.rows.map(item=>{
					return item.idCardNo
				})
				this.phoneNumber=res.rows.map(item=>{
					return item.phoneNumber
				})
			})
			//加载车辆类型
			getDicts('car_type').then(res=>{
				res.data.forEach(item=>{
					this.carType_[item.dictValue]=item.dictLabel
				})
				this.carType=res.data.map(item=>{
					return {
						value:item.dictValue,
						text:item.dictLabel
					}
				})
			})
			//获取车牌号下拉框
			getCarrierCarList({pageNum:1,pageSize:1000}).then(res=>{
				this.plateNumber=res.rows.map(item=>{
					return item.licensePlate
				})
				this.plateNumberObject=res.rows
			})
			//获取下拉框->运费计算方式
			getDicts('price_method').then(res=>{
				this.feeMode=res.data.map(item=>{
					return {
						value:item.dictValue,
						text:item.dictLabel
					}
				})
			})
			//获取下拉框->结算方式
			getDicts('settle_type').then(res=>{
				this.settleMode=res.data.map(item=>{
					return {
						value:item.dictValue,
						text:item.dictLabel
					}
				})
			})
			
		},
		methods: {
			//选择司机
			inpuDriverId(e){
				if(e)
				{
					let index=this.driverId.indexOf(e)
					let diver=this.allDriverList[index]
					this.driverJson=JSON.parse(diver.driverJson);
					this.plateNumberName=diver.plateNumberName
					this.inputPlateNumber(this.plateNumberName)
				}
			},
			//选择司机身份证号
			inpuIdCardNo(e){
				if(e)
				{
					let index=this.idCardNo.indexOf(e)
					let diver=this.allDriverList[index]
					this.driverJson=JSON.parse(diver.driverJson);
					this.plateNumberName=diver.plateNumberName
					this.inputPlateNumber(this.plateNumberName)
				}
			},
			//选择司机电话
			inpuPhoneNumber(e){
				if(e)
				{
					let index=this.phoneNumber.indexOf(e)
					let diver=this.allDriverList[index]
					this.driverJson=JSON.parse(diver.driverJson);
					this.plateNumberName=diver.plateNumberName
					this.inputPlateNumber(this.plateNumberName)
				}
			},
			// selectDriver(e){
			// 	this.driverId.forEach(item=>{
			// 		if(e===item.value)
			// 		{
			// 			this.driverJson=JSON.parse(item.driverJson);
			// 			this.plateNumberName=item.plateNumberName
			// 			this.inputPlateNumber(this.plateNumberName)
			// 		}
			// 	})
			// },
			//车牌号
			inputPlateNumber(e){
				if(e)
				{
					this.cartypeFlag=true  //车型输入框置灰
					//节流函数
					let that=this
					if(!that.statu)
					{
						return
					}
					that.statu=false
					setTimeout(()=>{
						let item=this.plateNumberObject.find(i=>i.licensePlate===e)
						if(item)
						{
							that.carInfo=item
							that.formData.carId=item.carId  //车辆id
							that.carJson=that.carInfo
						}
						else
						{
							that.carInfo=[]
						}
						// getCarrierCarDetails(e).then(res=>{
						// 	if(res.data)
						// 	{
						// 		that.carInfo=res.data
						// 		that.formData.carId=res.data.carId  //车辆id
						// 		that.carJson=that.carInfo
						// 	}
						// 	else
						// 	{
						// 		that.carInfo=[]
						// 	}
							
						// })
						that.statu=true;
					},1000)
					
				}
				else
				{
					this.cartypeFlag=false  //车型输入框恢复
				}
			},
			//选择车型
			selectCarType(e){
				this.carJson.carType=this.carInfo.carType
			},
			//设置承运商
			setCarrier(){
				this.carrierIdFlag=!this.carrierIdFlag
				//清空承运商信息
				this.$set(this.formData,'carrierId','')
			},
			//起始点
			startChange(e){
				this.initSort()
			},
			//中间节点
			centerChange(index,e){
				this.initSort()
			},
			//终点
			endChange(e){
				this.initSort()
			},
			//增加中间结点
			addCenterLine() {
				this.allCenterLine.push({
					value:''
				})
			},
			//删除中间某个节点
			deleteCenterLine(index){
				this.allCenterLine.splice(index,1)
				this.initSort()
			},
			//初始化排序函数
			initSort(){
				//每次调用清空
				this.allLine=[]
				
				let allLineValue=[]
				//放入起始点
				allLineValue.push({
					value:this.formData_point.startLine
				})
				//放入中间节点
				allLineValue.push(...this.allCenterLine)
				//放入终点
				allLineValue.push({
					value:this.formData_point.endLine
				})
				
				for(let i=0;i<allLineValue.length-1;i++)
				{
					let tem={
						prev:allLineValue[i].value,
						next:allLineValue[i+1].value,
						feeList:{
							settleMode:'',
							feeMode:'',
							apFrt:'',
							apOther:'',
							cod:'',
							codGascard:'',
							pom:'',
							pod:'',
							ms:'',
							estDepartTime:'',
							estArriveTime:'',
						}
					}
					this.allLine.push(tem)
				}
				
			},
			//取消保存
			cancelSubmit(){
				uni.navigateBack({
				    delta:1 // 可以不傳delta值，默認為1
				})
			},
			//确认调度信息
			submit(){
				this.$refs.form.validate().then(res => {
					if(!this.driverJson.driverName)
					{
						uni.showToast({
							title: '司机不能为空',
							icon:'none'
						})
						return
					}
					if(!this.driverJson.idCardNo)
					{
						uni.showToast({
							title: '身份证号不能为空',
							icon:'none'
						})
						return
					}
					if(!this.driverJson.phoneNumber)
					{
						uni.showToast({
							title: '联系电话不能为空',
							icon:'none'
						})
						return
					}
					if(!this.plateNumberName)
					{
						uni.showToast({
							title: '车牌号不能为空',
							icon:'none'
						})
						return
					}
					if(!this.carInfo.carType)
					{
						uni.showToast({
							title: '车型不能为空',
							icon:'none'
						})
						return
					}
					uni.showLoading({
						title: '正在调度...',
					})
					this.formData.feeList=this.allLine.map(item=>{
						return{
							depDeptId:item.prev,  //出发网点
							desDeptId:item.next,  //到达网点
							...item.feeList
						}
					})
					
					this.formData.waybillIds=[parseInt(this.waybillIds)]
					this.formData.flowStatus=400
					
					let stationList_start={
						branchDeptId:this.formData_point.startLine,  //网点部门id
						stationFlag:'0',  //0 起点 1 中间节点 2 终点
						status:'0'     //0 启用 1 停用
					}
					let stationList_center=this.allCenterLine.map(item=>{  //中间节点
						if(item.value)
						{
							return{
								branchDeptId:item.value,  //网点部门id
								stationFlag:'1',  //0 起点 1 中间节点 2 终点
								status:'0'     //0 启用 1 停用
							}
						}
					})
					let stationList_end={
						branchDeptId:this.formData_point.endLine,  //网点部门id
						stationFlag:'2',  //0 起点 1 中间节点 2 终点
						status:'0'     //0 启用 1 停用
					}
					let stationList=[stationList_start,...stationList_center,stationList_end]
					
					addLine({
						lineFlag:'1',
						lineName:'车辆调度新增人工设置',
						lineType:'0',
						manualType:'1',
						status:'1',
						stationList:stationList
					}).then(res => {
						uni.hideLoading()
						uni.showToast({
							title: '线路新增成功',
							icon: 'none'
						})
						if (res.code == '200') {
							this.formData.lineId=res.data.lineId
							
							this.formData.driverJson=this.driverJson
							this.formData.carJson=this.carJson
							addSchedule(this.formData).then(res2 => {
								if (res2.code == '200') {
									uni.showToast({
										title: '调度成功',
										icon: 'none'
									})
									
									let pages = getCurrentPages(); // 获取当前页面栈的实例，以数组形式按栈的顺序给出，第一个元素为首页，最后一个元素为当前页面。
									let nowPage = pages[pages.length - 1]; //当前页页面实例
									let prevPage = pages[pages.length - 2]; //上一页页面实例
									prevPage.$vm.otherFun() // 給上一頁綁定方法otherFun,傳參0（tabIndex：0）
									
									setTimeout(() => {
										uni.navigateBack({
											delta: 1 // 可以不傳delta值，默認為1
										})
									}, 1000)
								} else {
									uni.showToast({
										icon: 'none',
										title: res2.msg
									})
								}
							})
						} else {
							uni.hideLoading()
							uni.showToast({
								icon: 'none',
								title: res.msg
							})
						}
						
					})
				}).catch(err => {
					uni.showToast({
						title: err[0].errorMessage,
						icon: 'none'
					})
				})
			},
		},
	}
</script>

<style scoped>
.buttonHover {
		opacity: 0.6;
	}
	::v-deep .uni-select__input-box{
		width: 0vw;
	}
</style>